package com.itboye.ihomebank.util;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.TextView;

/**
 * lyf on 2017/02/17
 * 自定义TextView
 *
 * 投资记录表格
 */
public class MyTableTextView extends TextView {

	Paint paint = new Paint();

	public MyTableTextView(Context context, AttributeSet attrs) {
		super(context, attrs);
		int color = Color.parseColor("#8c8c8c");
		// 为边框设置颜色
		paint.setColor(color);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		// 画TextView的4个边
		canvas.drawLine(0, 0, this.getWidth() - 1, 0, paint);
		canvas.drawLine(0, 0, 0, this.getHeight() - 1, paint);
		canvas.drawLine(this.getWidth() - 1, 0, this.getWidth() - 1, this.getHeight() - 1, paint);
		canvas.drawLine(0, this.getHeight() - 1, this.getWidth() - 1, this.getHeight() - 1, paint);
	}
}